package lab02.test11;

/**
 * Created by 123 on 2017/10/17.
 */
public class Square extends Rectangle {

    public double diagonalLine() {
        width = length;
        double diagonaLine = Math.sqrt(2 * (this.length * this.length));
        System.out.println(diagonaLine);
        return diagonaLine;
    }

    public void printMyWay() {
        System.out.println("长" + this.length + "周长" + this.perimeter() + "面积" + this.area() + "对角线" + this.diagonalLine());
    }
}
